//
//  HomeDetailTableViewCell.m
//  share_business
//
//  Created by 吴于凌 on 2017/9/9.
//  Copyright © 2017年 wyl. All rights reserved.
//

#import "HomeDetailTableViewCell.h"

const static int height = 160 ;
@interface HomeDetailTableViewCell ()
@property(nonatomic,strong)UILabel *titleLabel ;
@property(nonatomic,strong)UILabel *detailLabel ;
@property(nonatomic,strong)UILabel *newestLabel ;
@property(nonatomic,strong)UILabel *oldLabel ;

@property(nonatomic,strong)UILabel *tip1Label ;//包邮
@property(nonatomic,strong)UILabel *tip2Label ;//7天退
@property(nonatomic,strong)UILabel *tip3Label ;//48小时

@property(nonatomic,strong)UILabel *codeLabel ;//包邮
@property(nonatomic,strong)UILabel *zekouLabel ;//7天退
@property(nonatomic,strong)UILabel *shareValueLabel ;//48小时

@end
@implementation HomeDetailTableViewCell

-(void)setUpView {
    int leftWidht = APPWIDTH -120 ;
    int rightWidht = 100 ;
    UIView *leftView = [[UIView alloc]initWithFrame:CGRectMake(10, 10, leftWidht, height)];
    UIView *rightView = [[UIView alloc]initWithFrame:CGRectMake(leftView.maxX, 10, rightWidht, height)];
    _titleLabel = [BSWidget commonLableWithFrame:CGRectZero text:@"法国进口红酒 450ml" color:nil font:15];
    _titleLabel.textColor = RGBA(51, 51, 51, 1);
    
    _detailLabel = [BSWidget commonLableWithFrame:CGRectZero text:@"微酸口感，口感清爽" color:nil font:15];
    _detailLabel.textColor = RGBA(102, 102, 102, 1);
    
    _newestLabel=[BSWidget commonLableWithFrame:CGRectZero text:@"¥499" color:nil font:18];
    _newestLabel.textColor = [UIColor orangeColor];
    
    _oldLabel = [BSWidget commonLableWithFrame:CGRectZero text:@"价格¥699" color:nil font:15];
    _oldLabel.textColor = RGBA(102, 102, 102, 1);
    
    _tip1Label = [BSWidget commonLableWithFrame:CGRectZero text:@"包邮" color:nil font:15];
    _tip2Label = [BSWidget commonLableWithFrame:CGRectZero text:@"7天退" color:nil font:15];
    _tip3Label = [BSWidget commonLableWithFrame:CGRectZero text:@"48小时" color:nil font:15];
    
    _codeLabel = [BSWidget commonLableWithFrame:CGRectZero text:@"商品编号:111111" color:nil font:13];
    _zekouLabel = [BSWidget commonLableWithFrame:CGRectZero text:@"等级折扣:20:00" color:nil font:13];
    _shareValueLabel = [BSWidget commonLableWithFrame:CGRectZero text:@"预分享值:520" color:nil font:13];
    _codeLabel.textColor = RGBA(102, 102, 102, 1);
    _zekouLabel.textColor = RGBA(102, 102, 102, 1);
    _shareValueLabel.textColor = RGBA(102, 102, 102, 1);
    
    
    _titleLabel.frame = CGRectMake(0, 0, leftWidht,28);
    _detailLabel.frame = CGRectMake(0, _titleLabel.maxY+5, leftWidht, 25);
    _newestLabel.frame = CGRectMake(0, _detailLabel.maxY+5, 80, 25);
    _oldLabel.frame = CGRectMake(_newestLabel.maxX, _detailLabel.maxY+5, leftWidht, 25);
    
    _tip1Label .frame = CGRectMake(0,_newestLabel.maxY+10, 53, 20);
    _tip1Label .textColor = [UIColor colorWithHexString:@"#87865a"];
    _tip1Label.textAlignment =NSTextAlignmentCenter ;
    [_tip1Label setBorder:1 cornerRadius:4 color:[UIColor colorWithHexString:@"#87865a"]];
    
    _tip2Label .frame = CGRectMake(_tip1Label.maxX+3, _tip1Label.y, 53, 20);
    _tip2Label .textColor = [UIColor colorWithHexString:@"#87865a"];
    _tip2Label.textAlignment =NSTextAlignmentCenter ;
    [_tip2Label setBorder:1 cornerRadius:4 color:[UIColor colorWithHexString:@"#87865a"]];
    
    _tip3Label.frame = CGRectMake(_tip2Label.maxX+3, _tip2Label.y, 53, 20);
    _tip3Label .textColor = [UIColor colorWithHexString:@"#87865a"];
    _tip3Label.textAlignment =NSTextAlignmentCenter ;
    [_tip3Label setBorder:1 cornerRadius:4 color:[UIColor colorWithHexString:@"#87865a"]];
    
    _codeLabel.frame = CGRectMake(0, 0, rightWidht, 20);
    _zekouLabel.frame = CGRectMake(0, _codeLabel.maxY+5, rightWidht, 20);
    _shareValueLabel.frame = CGRectMake(0, _zekouLabel.maxY +5, rightWidht, 20);
    
    [leftView addSubview:_titleLabel];
    [leftView addSubview:_detailLabel];
    [leftView addSubview:_newestLabel];
    [leftView addSubview:_oldLabel];
    [leftView addSubview:_tip1Label];
    [leftView addSubview:_tip2Label];
    [leftView addSubview:_tip3Label];
    
    [rightView addSubview:_codeLabel];
    [rightView addSubview:_zekouLabel];
    [rightView addSubview:_shareValueLabel];
    
    [self.contentView addSubview:rightView];
    [self.contentView addSubview:leftView];
    UIView *line = [[UIView alloc]initWithFrame:CGRectMake(0, height-15, APPWIDTH, 15)];
    line.backgroundColor = [UIColor colorWithHexString:@"#efefef"];
    [self.contentView addSubview:line];
}

@end
